package cs3343.project.family.testing;

import static org.junit.Assert.*;

import javax.swing.ImageIcon;

import org.junit.Test;
import static org.junit.Assert.*;
import cs3343.project.family.*;
import cs3343.project.family.Character;

public class EventCardTest {

	// Player choose option A for eventCard1
	// test single card
	@Test
	public void singleOption() {
		
		String cardNum=Integer.toString(2);
		int optionIdx=1;
		
		Card evtCard=new Card();
		CardController control=new CardController();
		control.importEventCard();
		
		evtCard=control.eventCards.get(cardNum);
		String result=evtCard.getResult(optionIdx);
			
		assertEquals(result, "+50");
	}

	@Test
	// All choose option 1  for n rounds
	//  pointChange: -100,-50,-100,+100,-50
	public void checkOptionTotal(){
		int n=5;   // number of card check
		int beginPoint=350;
		int ptChange=0;     // change made
		int ptFinal=0;   	// final point
		
		CardController control=new CardController();
		control.importEventCard();
		
		for(int i=1;i<=n;i++)
		{
			Card evtCard=control.eventCards.get(String.valueOf(i));
		//	System.out.print(evtCard.getResult(1));
			ptChange+=Integer.parseInt(evtCard.getResult(0));
		}	
		ptFinal=beginPoint+ptChange;
		assertEquals(ptFinal, 150);
		
	}

}
